package com.ihr360.payroll.scheduler;

import com.ihr360.payroll.service.alps.AlpsSyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class AlpsScheduler {
    @Value("${ihr360.config.enable.apls.scheduler:false}")
    private boolean enableSchduler;

    @Autowired
    AlpsSyncService alpsSyncService;
    @Scheduled(fixedDelay = 30000)
    private void syncServiceProfileInfo() {
        if (enableSchduler){
            alpsSyncService.syncApplications();
        }
    }
}
